home *** CD-ROM | disk | FTP | other *** search
- Path: news.pcix.com!root
- From: ed lizewski <elizewsk@capecod.net>
- Newsgroups: comp.lang.c++
- Subject: polymorphism and style
- Date: 26 Feb 1996 02:12:43 GMT
- Organization: Plymouth Commercial Internet eXchange
- Message-ID: <4gr4ur$n13@alpha.pcix.com>
- NNTP-Posting-Host: ost101.capecod.net
-
- Question on polymorphism and style.
- Want to call a function in a most derived class off a pointer to the base
- class. The fuction does not exist in the base class.
- I should:
- 1)downcast ?
- 2)add the function to the base class and add virtual stubs to every
- class that does not use it ?
- 3)add it to the base class but define it like
- foo( ..whatever..) {error_msg("virtual function not defined");}
- This way only the class that uses it would have to define it.
- 4) ?
-
- thanks for your time.
-